Creating custom property types

Properties provide the means to specify and examine the state, appearance, and behavior of nodes. For example, a property can define a color, indicate whether a button is pressed, or specify the alignment of an item.

Properties provide a uniform way to access data of Kanzi nodes, so that many Kanzi subsystems can manipulate the data. That way you can, for example, animate property values, provide bindings between property values, and monitor property value changes.

Each property is described by a property type. The property type uniquely describes the property where it is used, the name and the type of values the property holds. The data type defines the type of the data of the property.

Note that animations can only animate floating point numbers. So, to animate properties that have more than one value (for example, color and transformation), you can split the property data into a set of floating point property data attributes (for example, the RGBA channels in a color property type).

Setting and using namespaces for custom property types

The names of custom property types must be unique in a Kanzi application. When your Kanzi application uses .kzb files exported from different Kanzi Studio projects, to ensure that the names of custom property types remain unique within that application, use in each .kzb file a different namespace for custom property types.

When you create property types in Kanzi Engine plugins, use unique names across all plugins and Kanzi Studio projects you use in the same Kanzi application.

In Kanzi you can use these names to access a property type in your application:

To set the namespace for all custom property types in a Kanzi Studio project, in Kanzi Studio in the main menu select Project > Properties and set the Property Namespace property to the namespace you want to use for all custom property types in this project:

Creating a custom property

To create a custom property:

  1. In the Library press Alt and right-click Property Types and select Property Type.

    The Property Type Editor opens.
  2. In the Property Type Editor set:
  3. Click Save.
    You can now add and use the property you created just like any other property in Kanzi.

See also

Property system

Property types